{extend name="$_admin_base_layout" /} {block name="body"}
<div class="container-fluid" style="padding-top: 10px; background-color: rgb(240, 242, 245);">
    <div class="panel">
        <div class="panel-body">
            <form action="{:url('index')}" class="form-inline form-search">

                <div class="form-group">
                    <label>上级菜单：</label>
                    {html:select name="pid" options="menu_tree" selected="pid" clazz="form-control" first="全部"/}
                </div>

                <div class="form-group">
                    <label>菜单名称：</label>
                    <input type="text" class="form-control" name="title" value="{$title|default=''}">
                </div>
                <button type="submit" class="btn btn-primary">查询</button>
                <button type="button" class="btn btn-default btn-reset">重置</button>
            </form>
        </div>


        <!-- 数据表格 -->
        <table class="table table-sorter">
            <!-- 表头 -->
            <thead>
            <tr>
                <th style="width: 20px;">#</th>
                <th>菜单名称</th>
                <th>上级菜单</th>
                <th>下级菜单</th>
                <th>所在模块</th>
                <th>图标</th>
                <th>链接地址</th>
                <th>排序</th>
                <th>是否菜单</th>
                <th>开发模式</th>
                <th>是否隐藏</th>
                <th style="width: 80px;">状态</th>
                <th style="width: 80px;">操作</th>
            </tr>
            </thead>
            <!-- 列表 -->
            <tbody>
            {notempty name="data_list"} {volist name="data_list" id="info"}
            <tr>
                <td>{$i}</td>
                <td>{$info.title}</td>
                <td>{$info.parent_title|default='顶级菜单'}</td>
                <td>
                    {neq name="info['child_count']" value="0"}
                    <a href="{:url('index',['pid'=>$info['id']])}" class="text-primary">
                        {$info['child_count']}
                    </a>
                    {else}
                    无
                    {/neq}
                </td>
                <td>{$info.module_text}</td>
                <td>{$info.icon_text|raw}</td>
                <td>{$info.url}</td>
                <td>{$info.sort}</td>
                <td>{$info.is_menu_text}</td>
                <td>{$info.is_dev_text}</td>
                <td>{$info.hide_text}</td>
                <td>{$info.status_text|raw}</td>
                <td>
                    {html:auth name="admin/menu/edit"}
                    <a href="{:url('edit',array('id'=>$info['id']))}" data-toggle="modal" data-icon="edit"
                       data-backdrop="static" data-title="编辑菜单">编辑</a>
                    {/html:auth}
                    {html:auth name="admin/menu/delete"}
                    <a href="{:url('delete',array('id'=>$info['id']))}" class="confirm ajax-get text-danger">删除</a>
                    {/html:auth}
                </td>
            </tr>
            {/volist} {else/}
            <tr>
                <td class="text-center" colspan="13">aOh! 暂时还没有内容!</td>
            </tr>
            {/notempty}
            </tbody>
            <tfoot>
            <tr>
                <td colspan="13">{$pager||raw}</td>
            </tr>
            </tfoot>

        </table>
    </div>
</div>
{/block}
{block name="sub_menu_action"}
<ul class="nav nav-pills" style="margin-right: 10px;">
    {neq name="pid" value="0"}
    <li>
        <a href="{:url('index',['pid'=>$ppid])}" class="btn btn-link">
            <i class="icon icon-reply"></i> 返回上一级
        </a>
    </li>
    {/neq}
    {html:auth name="admin/menu/add"}
    <li>
        <a href="{:url('add', ['pid'=>$pid])}" class="btn btn-link" data-toggle="modal" data-icon="plus" data-backdrop="static" data-title="新增菜单">
            <i class="icon-plus"></i> 新增
        </a>
    </li>
    {/html:auth}
    {html:auth name="admin/menu/sort"}
    <li>
        <a href="{:url('sort', array('pid'=>$pid))}" id="btn-sort" class="btn btn-link" data-value="{$pid}"
           data-toggle="modal" data-icon="sort-by-alphabet" data-backdrop="static" data-title="菜单排序">
            <i class="icon-sort-by-alphabet"></i> 排序
        </a>
    </li>
    {/html:auth}

</ul>
{/block}
{block name="script"}
<script>
    $(function () {
        $('#btn-sort').click(function () {
            //$(this).addClass('disabled');
            var pid = $(this).attr('data-value');
        });
    });
</script>
{/block}
